home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
dev
/
e
/
epp_v1_1.lha
/
EPP
/
PModules
/
cSkipNonWhite.e
< prev
next >
Wrap
Text File
|
1993-06-26
|
1KB
|
34 lines
OPT TURBO
PROC cSkipNonWhite (pos : PTR TO CHAR)
/*----------------------------------------------------------------------*/
/* pos must point into a null-terminated string! */
/* pos must be passed by value! */
/* pos must not point beyond the end of the string when it's passed in! */
/* */
/* Skips SPACE, TAB, LF, CR. Returns end pos so that the following */
/* statement sequence can be used in the calling program: */
/* length := (cSkipNonWhite (startPos) - startPos) */
/* MidStr (someString, startPos, 0, length) */
/* */
/* If you use the string with index method in your main program, you */
/* can get the PTR TO CHAR pos by using: */
/* length := (cSkipNonWhite (string + index) - (string + index)) */
/* MidStr (someString, string, index, length) */
/*----------------------------------------------------------------------*/
DEF c
WHILE (c := pos [])
SELECT c
CASE 32; RETURN pos /* SPACE */
CASE 9; RETURN pos /* TAB */
CASE 10; RETURN pos /* LF */
CASE 13; RETURN pos /* CR */
DEFAULT; INC pos
ENDSELECT
ENDWHILE
ENDPROC pos
/* cSkipNonWhite */